<!--
 * @Author: coman
 * @LastEditors: coman
 * @Date: 2020-06-16 16:10:05
 * @motto: No pain,No gain
 * @LastEditTime: 2020-06-16 16:16:21
--> 
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 冒泡排序 -->
    <script>
    var arr = [4,9,3,77,54,36,99];
    for(var i=0;i<arr.length;i++){
        for(j=0;j<arr.length-i-1;j++){
            if(arr[j]>arr[j+1]){
                var temp = arr[j];
                arr[j] =arr[j+1];
                arr[j+1] =temp;
            }
        }
    }
    console.log("冒泡排序:"+arr);
    
    </script>
   
</body>
</html>